

<!-- Replace "reference" with the reference name you want, just keep the same -prev -next -item-0 -item-1 etc... add or remove items as needed  -->
<div id="reference-first">First</div>
<div id="reference-prev">Prev</div>
<div id="reference-item-0">0</div>
<div id="reference-item-1">1</div>
<div id="reference-item-2">2</div>
<div id="reference-item-3">3</div>
<div id="reference-next">Next</div>
<div id="reference-last">Last</div>

<script src="mg.min.js" type="text/javascript"></script>

<script type="text/javascript">

// Replace "click" with the javascript event name you want to use: click, dblclick, mousedown, mouseup, mousemove, mouseenter OR mouseover, mouseleave OR mouseout, touchstart, touchend, touchcancel, touchleave, touchmove, focus
var mgObject = new Mg({
	// For the constructor api visit http://www.minimit.com/articles/minimit-gallery-2-0-guide#constructorApi
	reference:"reference",
	click:{
		activated:[0],
		cycle:true,
		prevSteps:2, nextSteps:2,
		prevToSteps:true, nextToSteps:true,
		interactive:true,
		anchorize:false,
		linked:[otherMgObject],
		linkedMultiply:2,
		maxActivated:Infinity,
		deactivable:true,
		multiLess:1, multiPlus:1,
		auto:1000, autoSlow:5000, autoInverse:true
	}
});
mgObject.click.onEvent = function(isInit){
	// For the events api visit http://www.minimit.com/articles/minimit-gallery-2-0-guide#eventsApi
	if(isInit){
		// init animations or variables here
	}else{
		// event animations or variables here
	}
}
mgObject.click.prevHide = function(){}
mgObject.click.prevShow = function(){}
mgObject.click.nextHide = function(){}
mgObject.click.nextShow = function(){}
mgObject.click.nextClick = function(){}
mgObject.click.prevClick = function(){}
mgObject.init();

// For the methods api visit http://www.minimit.com/articles/minimit-gallery-2-0-guide#methodsApi
mgObject.init();
mgObject.setSettings({/* same as constructor */});
mgObject.refreshItems();
mgObject.setState(num, evnt, alsoLinked, pauseAuto, isInit); // setState(num:number, evnt:string, alsoLinked:boolean, pauseAuto:boolean, isInit:boolean) – set a state in a event, null in the num to deactivate the event gallery
mgObject.autoStart("click");
mgObject.autoSlow("click");
mgObject.autoStop("click");
mgObject.mapNum(num:number, less:number, plus:number, max:number, cycle:boolean); // returns a maps a serie of numbers based on num +- add, between 0 and max (ex: 4, 5, 0, 1, 2)
mgObject.mapDistance(center:number, num:number); // returns the distance between num and center, with center having the lowest number, based on max and min (ex: 2,1,0,1,2)
mgObject.mapDistanceReverse(center:number, num:number, max:number, min:number); // returns the reverse distance between num and center, with center having the highest number, based on max and min (ex: 0,1,2,1,0)
mgObject.findNearestDistance(i:number, z:number, max:number, cycle:boolean); // returns the nearest distance between i and z, considering values from 0 to max

</script>
